<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google-site-verification" content="VGgQeH6NiuAKspyCFT7dqUNmNhg6RJoMYQXErdy0jgE" />
  <meta name="baidu-site-verification" content="code-yNmdsKJ9GP" />
  
  
  
  <title>
    
    思远程序
  </title>
  <!-- Icon -->
  
    <link rel="shortcut icon" href="/favicon.ico">
    
  
<link rel="stylesheet" href="/css/style.css">

  
  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
  
<script src="/js/pace.min.js"></script>

<meta name="generator" content="Hexo 6.2.0"></head>

<body>
  <main class="content">
    <section class="jumbotron">
  <div class="video">
    
    <div class="video-frame">
      <img src="/images/ocean/overlay-hero.png" alt="Decorative image frame">
    </div>
    
    <div class="video-media">
      <video playsinline="" autoplay="" loop="" muted="" data-autoplay="" poster="/images/ocean/ocean.png"
        x5-video-player-type="h5">
<!--         <source src="/images/ocean/ocean.mp4" type="video/mp4"> -->
        <source src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/ocean.mp4" type="video/mp4">
        <source src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/ocean.ogv" type="video/ogg">
        <source src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/ocean.webm" type="video/webm">
        <p>Your user agent does not support the HTML5 Video element.</p>
      </video>
      <div class="video-overlay"></div>
    </div>
    <div class="video-inner text-center text-white">
      <h1><a href="/">思远程序</a></h1>
      <p>思而不藏，我思不远。</p>
      <div><img src="/images/hexo-inverted.svg" class="brand" alt="思远程序"></div>
    </div>
    <div class="video-learn-more">
      <a class="anchor" href="#landingpage"><i class="fe fe-mouse"></i></a>
    </div>
  </div>
</section>
<div id="landingpage">
  <section class="outer">
  <article class="articles">
    
    <h1 class="page-type-title"></h1>
    
    
    <article id="post-mybatis-plus-多数据源" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/10/25/mybatis-plus-%E5%A4%9A%E6%95%B0%E6%8D%AE%E6%BA%90/">mybatis-plus 多数据源</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/10/25/mybatis-plus-%E5%A4%9A%E6%95%B0%E6%8D%AE%E6%BA%90/" class="article-date">
  <time datetime="2022-10-25T07:48:29.000Z" itemprop="datePublished">2022-10-25</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/Mybatis/">Mybatis</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/10/25/mybatis-plus-%E5%A4%9A%E6%95%B0%E6%8D%AE%E6%BA%90/" rel="gallery_cl9nwvqv20000ip6f22nzhbns">
      <img src="/" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <blockquote>
<p>Mybatis-plus 官网：<a target="_blank" rel="noopener" href="https://baomidou.com/">https://baomidou.com/</a></p>
</blockquote>
<p>整体项目目录：</p>
<p><img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202210251541521.png" alt="image-20221025152907183"></p>
        
          <p>
            <a class="article-more-link" href="/2022/10/25/mybatis-plus-%E5%A4%9A%E6%95%B0%E6%8D%AE%E6%BA%90/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/10/25/mybatis-plus-%E5%A4%9A%E6%95%B0%E6%8D%AE%E6%BA%90/" data-id="cl9nwvqv20000ip6f22nzhbns" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mybatis-plus/" rel="tag">Mybatis-plus</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-14. Elasticsearch 聚合性能优化" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/14.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/">14. Elasticsearch 聚合性能优化</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/14.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" class="article-date">
  <time datetime="2022-07-23T15:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/14.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" rel="gallery_cl6bukbt3000fsu6fehln0kz8">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <h5 id="启用-eager-global-ordinals-提升高基数聚合性能"><a href="#启用-eager-global-ordinals-提升高基数聚合性能" class="headerlink" title="启用 eager global ordinals 提升高基数聚合性能"></a>启用 eager global ordinals 提升高基数聚合性能</h5><p>适用场景：高基数聚合 。<br>高基数聚合场景中的高基数含义：一个字段包含很大比例的唯一值。<br>global ordinals 中文翻译成全局序号，是一种数据结构，应用场景如下： </p>
<ul>
<li>基于 keyword，ip 等字段的分桶聚合，包含：terms聚合、composite 聚合 等。 </li>
<li>基于text 字段的分桶聚合（前提条件是：fielddata 开启）。 </li>
<li>基于父子文档 Join 类型的 has_child 查询和 父聚合。</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/14.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/14.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" data-id="cl6bukbt3000fsu6fehln0kz8" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-13. Elasticsearch 聚合分析不精准原因" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/13.%20Elasticsearch%20%E8%81%9A%E5%90%88%E5%88%86%E6%9E%90%E4%B8%8D%E7%B2%BE%E5%87%86%E5%8E%9F%E5%9B%A0/">13. Elasticsearch 聚合分析不精准原因</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/13.%20Elasticsearch%20%E8%81%9A%E5%90%88%E5%88%86%E6%9E%90%E4%B8%8D%E7%B2%BE%E5%87%86%E5%8E%9F%E5%9B%A0/" class="article-date">
  <time datetime="2022-07-23T14:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/13.%20Elasticsearch%20%E8%81%9A%E5%90%88%E5%88%86%E6%9E%90%E4%B8%8D%E7%B2%BE%E5%87%86%E5%8E%9F%E5%9B%A0/" rel="gallery_cl6bukbt0000bsu6f4t3d7nxh">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <p>ElasticSearch在对海量数据进行聚合分析的时候会损失搜索的精准度来满足实时性的需求。<br><img src="https://cdn.nlark.com/yuque/0/2022/png/1445568/1658902868049-fba2d2de-7574-44b3-be8b-31ef73dcce63.png#clientId=u31424d87-c156-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=278&id=u3c59122c&margin=%5Bobject%20Object%5D&name=image.png&originHeight=536&originWidth=784&originalType=binary&ratio=1&rotation=0&showTitle=false&size=102371&status=done&style=none&taskId=ufc32e5e1-8f15-4430-86ab-79a72632a0f&title=&width=407" alt="image.png"></p>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/13.%20Elasticsearch%20%E8%81%9A%E5%90%88%E5%88%86%E6%9E%90%E4%B8%8D%E7%B2%BE%E5%87%86%E5%8E%9F%E5%9B%A0/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/13.%20Elasticsearch%20%E8%81%9A%E5%90%88%E5%88%86%E6%9E%90%E4%B8%8D%E7%B2%BE%E5%87%86%E5%8E%9F%E5%9B%A0/" data-id="cl6bukbt0000bsu6f4t3d7nxh" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-12. Elassearch 聚合的作用范围" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/12.%20Elassearch%20%E8%81%9A%E5%90%88%E7%9A%84%E4%BD%9C%E7%94%A8%E8%8C%83%E5%9B%B4/">12. Elassearch 聚合的作用范围</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/12.%20Elassearch%20%E8%81%9A%E5%90%88%E7%9A%84%E4%BD%9C%E7%94%A8%E8%8C%83%E5%9B%B4/" class="article-date">
  <time datetime="2022-07-23T13:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/12.%20Elassearch%20%E8%81%9A%E5%90%88%E7%9A%84%E4%BD%9C%E7%94%A8%E8%8C%83%E5%9B%B4/" rel="gallery_cl6bukbsz0009su6f4yiy1jrm">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <h5 id="聚合范围"><a href="#聚合范围" class="headerlink" title="聚合范围"></a>聚合范围</h5><p>ES聚合分析的默认作用范围是query的查询结果集，同时ES还支持以下方式改变聚合的作用范围： </p>
<ul>
<li>Filter </li>
<li>Post Filter </li>
<li>Global</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/12.%20Elassearch%20%E8%81%9A%E5%90%88%E7%9A%84%E4%BD%9C%E7%94%A8%E8%8C%83%E5%9B%B4/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/12.%20Elassearch%20%E8%81%9A%E5%90%88%E7%9A%84%E4%BD%9C%E7%94%A8%E8%8C%83%E5%9B%B4/" data-id="cl6bukbsz0009su6f4yiy1jrm" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-11. Elasticsearch 聚合操作" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/11.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%93%8D%E4%BD%9C/">11. Elasticsearch 聚合操作</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/11.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%93%8D%E4%BD%9C/" class="article-date">
  <time datetime="2022-07-23T12:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/11.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%93%8D%E4%BD%9C/" rel="gallery_cl6bukbst0003su6f0siq7f8p">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <p>Elasticsearch除搜索以外，提供了针对ES 数据进行统计分析的功能。聚合(aggregations) 可以让我们极其方便的实现对数据的统计、分析、运算。例如：</p>
<ul>
<li>什么品牌的手机最受欢迎？ </li>
<li>这些手机的平均价格、最高价格、最低价格？ </li>
<li>这些手机每月的销售情况如何？</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/11.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%93%8D%E4%BD%9C/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/11.%20Elasticsearch%20%E8%81%9A%E5%90%88%E6%93%8D%E4%BD%9C/" data-id="cl6bukbst0003su6f0siq7f8p" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-10. Elasticsearch 单字符串多字段查询" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/10.%20Elasticsearch%20%E5%8D%95%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2/">10. Elasticsearch 单字符串多字段查询</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/10.%20Elasticsearch%20%E5%8D%95%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2/" class="article-date">
  <time datetime="2022-07-23T11:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/10.%20Elasticsearch%20%E5%8D%95%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2/" rel="gallery_cl6bukbsx0007su6fh3fvbw72">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <p>三种场景：</p>
<ul>
<li>最佳字段(Best Fields)</li>
</ul>
<p>当字段之间相互竞争，又相互关联。例如，对于博客的 title和 body这样的字段，评分来自最匹配字段；</p>
<ul>
<li>多数字段(Most Fields)</li>
</ul>
<p>处理英文内容时的一种常见的手段是，在主字段( English Analyzer)，抽取词干，加入同义词，以匹配更多的文档。相同的文本，加入子字段（Standard Analyzer），以提供更加精确的匹 配。其他字段作为匹配文档提高相关度的信号，匹配字段越多则越好。 </p>
<ul>
<li>混合字段(Cross Field)</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/10.%20Elasticsearch%20%E5%8D%95%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/10.%20Elasticsearch%20%E5%8D%95%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2/" data-id="cl6bukbsx0007su6fh3fvbw72" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-9. Elasticsearch Bosting Query" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/9.%20Elasticsearch%20Bosting%20Query/">9. Elasticsearch Bosting Query</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/9.%20Elasticsearch%20Bosting%20Query/" class="article-date">
  <time datetime="2022-07-23T10:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/9.%20Elasticsearch%20Bosting%20Query/" rel="gallery_cl6bukbtd0014su6fcv5c4kv9">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <p>如何控制查询的相关性算分？<br>控制字段的Boosting Boosting是控制相关的一种手段。可以通过指定字段的boost值影响查询结果<br>参数boost的含义： </p>
<ul>
<li>当boost &gt; 1时，打分的权重相对性提升；</li>
<li>当0 &lt; boost &lt;1时，打分的权重相对性降低；</li>
<li>当boost &lt;0时，贡献负分；</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/9.%20Elasticsearch%20Bosting%20Query/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/9.%20Elasticsearch%20Bosting%20Query/" data-id="cl6bukbtd0014su6fcv5c4kv9" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-8. Elasticsearch 布尔查询 bool Query" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/8.%20Elasticsearch%20%E5%B8%83%E5%B0%94%E6%9F%A5%E8%AF%A2%20bool%20Query/">8. Elasticsearch 布尔查询 bool Query</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/8.%20Elasticsearch%20%E5%B8%83%E5%B0%94%E6%9F%A5%E8%AF%A2%20bool%20Query/" class="article-date">
  <time datetime="2022-07-23T09:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/8.%20Elasticsearch%20%E5%B8%83%E5%B0%94%E6%9F%A5%E8%AF%A2%20bool%20Query/" rel="gallery_cl6bukbtc0011su6f3kr40sei">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <h4 id="布尔查询bool-Query"><a href="#布尔查询bool-Query" class="headerlink" title="布尔查询bool Query"></a>布尔查询bool Query</h4><p>一个bool查询，是一个或者多个查询子句的组合，总共包括4种子句，其中2种会影响算分， 2种不影响算分。 </p>
<ul>
<li>must: 相当于<code>&amp;&amp;</code> ，必须匹配，贡献算分；</li>
<li>should: 相当于 <code>||</code> ，选择性匹配，贡献算分；</li>
<li>must_not: 相当于 <code>!</code> ，必须不能匹配，不贡献算分；</li>
<li>filter: 必须匹配，不贡献算法；</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/8.%20Elasticsearch%20%E5%B8%83%E5%B0%94%E6%9F%A5%E8%AF%A2%20bool%20Query/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/8.%20Elasticsearch%20%E5%B8%83%E5%B0%94%E6%9F%A5%E8%AF%A2%20bool%20Query/" data-id="cl6bukbtc0011su6f3kr40sei" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-7. Elasticsearch 相关性和相关性算分" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/7.%20Elasticsearch%20%E7%9B%B8%E5%85%B3%E6%80%A7%E5%92%8C%E7%9B%B8%E5%85%B3%E6%80%A7%E7%AE%97%E5%88%86/">7. Elasticsearch 相关性和相关性算分</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/7.%20Elasticsearch%20%E7%9B%B8%E5%85%B3%E6%80%A7%E5%92%8C%E7%9B%B8%E5%85%B3%E6%80%A7%E7%AE%97%E5%88%86/" class="article-date">
  <time datetime="2022-07-23T08:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/7.%20Elasticsearch%20%E7%9B%B8%E5%85%B3%E6%80%A7%E5%92%8C%E7%9B%B8%E5%85%B3%E6%80%A7%E7%AE%97%E5%88%86/" rel="gallery_cl6bukbtb000ysu6fbuih0lzh">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <h4 id="相关性和相关性算分"><a href="#相关性和相关性算分" class="headerlink" title="相关性和相关性算分"></a>相关性和相关性算分</h4><p>搜索是用户和搜索引擎的对话，用户关心的是搜索结果的相关性 </p>
<ul>
<li>是否可以找到所有相关的内容；</li>
<li>有多少不相关的内容被返回了；</li>
<li>文档的打分是否合理 结合业务需求，平衡结果排名；</li>
</ul>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/7.%20Elasticsearch%20%E7%9B%B8%E5%85%B3%E6%80%A7%E5%92%8C%E7%9B%B8%E5%85%B3%E6%80%A7%E7%AE%97%E5%88%86/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/7.%20Elasticsearch%20%E7%9B%B8%E5%85%B3%E6%80%A7%E5%92%8C%E7%9B%B8%E5%85%B3%E6%80%A7%E7%AE%97%E5%88%86/" data-id="cl6bukbtb000ysu6fbuih0lzh" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
    <article id="post-6. Elasticsearch 结构化搜索" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
      

<h2 itemprop="name">
  <a class="article-title" href="/2022/07/23/6.%20Elasticsearch%20%E7%BB%93%E6%9E%84%E5%8C%96%E6%90%9C%E7%B4%A2/">6. Elasticsearch 结构化搜索</a>
</h2>



    </header>
    

    
    <div class="article-meta">
      <a href="/2022/07/23/6.%20Elasticsearch%20%E7%BB%93%E6%9E%84%E5%8C%96%E6%90%9C%E7%B4%A2/" class="article-date">
  <time datetime="2022-07-23T07:00:00.000Z" itemprop="datePublished">2022-07-23</time>
</a>
      
<div class="article-category">
  <a class="article-category-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E6%A1%86%E6%9E%B6/">分布式框架</a>
</div>

    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      
      
        
<div class="article-gallery">
  <div class="article-gallery-photos">
    
    
    <a class="article-gallery-img" href="/2022/07/23/6.%20Elasticsearch%20%E7%BB%93%E6%9E%84%E5%8C%96%E6%90%9C%E7%B4%A2/" rel="gallery_cl6bukbta000vsu6fdrr5b5db">
      <img src="https://siyit-blog.oss-cn-hangzhou.aliyuncs.com/images/2022202207231056377.png" itemprop="image">
    </a>
    
    
  </div>
</div>

      
      
        <p>结构化搜索(Structured search)是指对结构化数据的搜索。<br>结构化数据： </p>
<ul>
<li>日期，布尔类型和数字都是结构化的；</li>
<li>文本也可以是结构化的。 <ul>
<li>如彩色笔可以有离散的颜色集合：红(red) 、绿(green、蓝 (blue)</li>
<li>一个博客可能被标记了标签，例如，分布式(distributed)和搜索(search) </li>
<li>电商网站上的商品都有UPC(通用产品码Universal Product Code)或其他的唯一 标识，它们都需要遵从严格规定的、结构化的格式。</li>
<li>
        
          <p>
            <a class="article-more-link" href="/2022/07/23/6.%20Elasticsearch%20%E7%BB%93%E6%9E%84%E5%8C%96%E6%90%9C%E7%B4%A2/">
              阅读全文...
            </a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://siyit.gitee.io/2022/07/23/6.%20Elasticsearch%20%E7%BB%93%E6%9E%84%E5%8C%96%E6%90%9C%E7%B4%A2/" data-id="cl6bukbta000vsu6fdrr5b5db" class="article-share-link">
        分享
      </a>
      
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Elasticsearch/" rel="tag">Elasticsearch</a></li></ul>

    </footer>

  </div>

  

  

</article>
    
  </article>
  

  
  <nav class="page-nav">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><a class="extend next" rel="next" href="/page/2/">下一页</a>
  </nav>
  
</section>
</div>
    <footer class="footer">
  <div class="outer">
    <div class="float-right">
      <ul class="list-inline">
  
  <li><i class="fe fe-bar-chart"></i> <span id="busuanzi_value_site_pv"></span></li>
  
  <li><i class="fe fe-smile-alt"></i> <span id="busuanzi_value_site_uv"></span></li>
  
</ul>
    </div>
    <ul class="list-inline">
      <li>思远程序 &copy; 2022</li>
      
        <li></li>
      
      <li>Powered by <a href="http://hexo.io/" target="_blank">Hexo</a></li>
      <li>theme  <a target="_blank" rel="noopener" href="https://github.com/zhwangart/hexo-theme-ocean">Ocean</a></li>
    </ul>
  </div>
</footer>
  </main>
  <aside class="sidebar">
    <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/hexo.svg" alt="思远程序"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/recommend">推荐</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/gallery">相册</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/favorites">收藏</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link nav-item-search" title="搜索">
        <i class="fe fe-search"></i>
        搜索
      </a>
    </li>
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      <div class="totop" id="totop">
  <i class="fe fe-rocket"></i>
</div>
    </li>
    <li class="nav-item">
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="fe fe-feed"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
  </aside>
  
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>



<script src="/fancybox/jquery.fancybox.min.js"></script>






<script src="/js/ocean.js"></script>

</body>

</html>